package com.jsmile.cloud.accountcenter.api.feign;

import javax.validation.Valid;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.jsmile.cloud.accountcenter.api.constants.AccountConstants;
import com.jsmile.cloud.accountcenter.api.req.shop.ReqSupplyCreate;
import com.jsmile.cloud.accountcenter.api.req.shop.ReqSupplyDelete;
import com.jsmile.cloud.accountcenter.api.req.shop.ReqSupplyQuery;
import com.jsmile.cloud.accountcenter.api.req.shop.ReqSupplyUpdate;
import com.jsmile.cloud.accountcenter.api.res.ResSupply;
import com.jsmile.mall.api.JSmileResult;
import com.jsmile.mall.api.to.JsmilePage;

@FeignClient(value = AccountConstants.APPLICATION_NAME, contextId = "supply")
public interface SupplyServiceApi {

    // TODO 获取供应商信息
    @RequestMapping(value = "/feign/supply/getSupply", method = RequestMethod.POST)
    JSmileResult<ResSupply> getSupply(@RequestBody @Valid ReqSupplyDelete reqSupplyDelete);

    // TODO 添加供应商信息
    @RequestMapping(value = "/feign/supply/addSupply", method = RequestMethod.POST)
    JSmileResult<ResSupply> addSupply(@RequestBody @Valid ReqSupplyCreate reqSupplyCreate);

    // TODO 更新供应商信息
    @RequestMapping(value = "/feign/supply/updateSupply", method = RequestMethod.POST)
    JSmileResult<ResSupply> updateSupply(@RequestBody @Valid ReqSupplyUpdate reqSupplyUpdate);

    // TODO 获取供应商列表
    @RequestMapping(value = "/feign/supply/list", method = RequestMethod.POST)
    JSmileResult<JsmilePage<ResSupply>> getSupplyPageList(@RequestBody @Valid ReqSupplyQuery reqSupplyQuery);
}
